package com.probox.common.entity.domain.order.vo;

import com.probox.common.core.utils.money.PriceFormatUtil;
import com.probox.order.api.domain.OrderItemVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
@ApiModel("子订单信息")
public class OrderMergeDetailVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "订单ID")
    private Long orderUid;

    @ApiModelProperty(value = "订单编号")
    private String orderNo;


    @ApiModelProperty(value = "商品金额（不含运费）")
    private Long orderAmount;

    @ApiModelProperty(value = "支付金额(不含运费，已经减去代金券、减去余额、减去折扣金额)")
    private Long payAmount;

    @ApiModelProperty(value = "运费")
    private Long freightAmount;

    @ApiModelProperty(value = "实际所需支付金额（支付金额 + 运费）")
    private Long actualAmount;

    @ApiModelProperty(value = "是否是当前子订单(0不是1是)")
    private String isCurrent;

    @ApiModelProperty(value = "支付订单号（催付款,支付时用到）")
    private String parentOrderNo;

    @ApiModelProperty(value = "是否需要合并支付(0不是1是)，仅催付款时用到")
    private String isMergePay;

    @ApiModelProperty(value = "商品信息")
    private List<OrderItemVo> itemVoList;

    public String getOrderAmountStr(){
        return PriceFormatUtil.format(orderAmount);
    }

    public String getPayAmountStr(){
        return PriceFormatUtil.format(payAmount);
    }

    public String getFreightAmountStr(){
        return PriceFormatUtil.format(freightAmount);
    }

    public String getActualAmountStr(){
        return PriceFormatUtil.format(actualAmount);
    }

}
